package com.hkbigdata.sybx.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author yangjing
 * @creat 2025-05-28-11:44
 * @email 3010335359@qq.com
 */
@Mapper
public interface  HeartRateMapper {
    // 获取指定 user_id 当天心率和时间数据
    @Select("SELECT heart_rate, DATE_FORMAT(record_time, '%H:%i') as record_time " +
            "FROM elder_health_data " +
            "WHERE user_id = #{userId} AND DATE(record_time) = CURDATE()")
    List<Map<String, Object>> getHeartRateByUserId(String userId);

    // 获取指定 user_id 当天血糖和时间数据（血糖数据取前3位）

}